<template>
  <el-card class="pro-card-item" shadow="hover">
    <template #header>
      <div class="card-header">
        <slot name="header" :row="data"></slot>
      </div>
    </template>

    <div class="card-content">
      <slot :row="data"></slot>
    </div>

    <div class="card-footer" v-if="$slots.footer">
      <slot name="footer" :row="data"></slot>
    </div>
  </el-card>
</template>

<script setup lang="ts">
interface CardItemProps {
  data: any; // 卡片数据
}

withDefaults(defineProps<CardItemProps>(), {
  data: () => ({})
});
</script>

<style lang="scss" scoped>
.pro-card-item {
  :deep(.el-card__header) {
    padding: 12px 20px;
    border-bottom: 1px solid var(--el-border-color-light);
  }
  :deep(.el-card__body) {
    padding: 10px 18px;
  }
  .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .card-content {
    min-height: 120px;
  }
  .card-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-top: 15px;
    margin-top: 15px;
    font-size: 16px;
    border-top: 1px solid var(--el-border-color-lighter);
  }
}
</style>
